﻿using BrnMall.Manager.Domain.Ship;
using BrnMall.Web.Framework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BrnMall.Web.StoreAdmin.Models
{
    public class ShipIndexModel
    {
        /// <summary>
        /// 配送余额
        /// </summary>
        public string Cash { get; set; }
        /// <summary>
        /// 达达门店状态 (0未开通, 1 已开通)
        /// </summary>
        public int ShopState { get; set; }
        /// <summary>
        /// 店铺地址
        /// </summary>
        public string ShopAdress { get; set; }

    }
    public class ShipRecordListModel
    {
        public int uid { get; set; }

        /// <summary>
        /// 账户名
        /// </summary>
        public string AccountName { get; set; }

        public string StartTime { get; set; }

        public string EndTime { get; set; }
        /// <summary>
        /// 消费明细
        /// </summary>
        public IList<ShipRecord> List { get; set; }

        public PageModel PageModel { get; set; }
        /// <summary>
        /// 收支类型
        /// </summary>
        public int Direction { get; set; }
        /// <summary>
        /// 时间段内总收入
        /// </summary>
        public decimal TimeInMoney { get; set; }
        /// <summary>
        /// 时间段内中支出
        /// </summary>
        public decimal TimeOutMoney { get; set; }
    }

    public class ShipRecordView : ShipRecord
    {
        /// <summary>
        /// 账户名
        /// </summary>
        public string AccountName { get; set; }
    }

    /// <summary>
    /// 配送设置
    /// </summary>
    public class ShipConfigModel
    {
        public int Id { get; set; }

        public int StoreId { get; set; }

        /// <summary>
        /// 是否自动配送(0人工配送, 1 自动配送)
        /// </summary>
        public int IsAutoShip { get; set; }
        /// <summary>
        /// 配送金额
        /// </summary>
        [Range(0, float.MaxValue, ErrorMessage = "配送金额不能小于0")]
        [Required(ErrorMessage = "配送金额不能为空")]
        public decimal ShipMoney { get; set; }

        /// <summary>
        /// 最大配送距离
        /// </summary>
        [Range(0, float.MaxValue, ErrorMessage = "最大配送距离不能小于0公里")]
        [Required(ErrorMessage = "最大配送距离不能为空")]
        public float MaxDistance { get; set; }
    }
}
